package com.wicket.okrcomponent.web.contorller;
import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;
import com.wicket.okrcomponent.biz.service.UnstructuredDataService;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import com.wicket.okrcomponent.common.ro.OkrResult;
import com.wicket.okrcomponent.common.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/comp/unstructuredData/")
public class UnstructuredDataController {

    @Resource
    private RedisUtil redisUtil;

    @Autowired
    UnstructuredDataService  unstructuredDataService;

    /**
   * D2-批量查询文档列表(公共)
   */
    @PostMapping("batchQueryDocumentCom")
    public OkrResult<BatchQueryDocumentComRespDto> batchQueryDocumentCom(@RequestBody @Validated BatchQueryDocumentComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchQueryDocumentCom(reqDTO));
    }
/**
   * D2-7查询文档详情(公共)
   */
    @PostMapping("queryDocumentDetailCom")
    public OkrResult<QueryDocumentDetailComRespDto> queryDocumentDetailCom(@RequestBody @Validated QueryDocumentDetailComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.queryDocumentDetailCom(reqDTO));
    }
/**
   * D2-7批量查询文件夹(公共)
   */
    @PostMapping("batchQueryDataFolderCom")
    public OkrResult<BatchQueryDataFolderComRespDto> batchQueryDataFolderCom(@RequestBody @Validated BatchQueryDataFolderComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchQueryDataFolderCom(reqDTO));
    }
/**
   * D2-7批量修改文件夹(公共)
   */
    @PostMapping("batchUpdateDataFolderCom")
    public OkrResult<BatchUpdateDataFolderComRespDto> batchUpdateDataFolderCom(@RequestBody @Validated BatchUpdateDataFolderComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchUpdateDataFolderCom(reqDTO));
    }
/**
   * D2-7批量修改文档(公共)
   */
    @PostMapping("batchUpdateDocumentCom")
    public OkrResult<BatchUpdateDocumentComRespDto> batchUpdateDocumentCom(@RequestBody @Validated BatchUpdateDocumentComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchUpdateDocumentCom(reqDTO));
    }
/**
   * D2-7新增文档(公共)（待确认后删除）
   */
    @PostMapping("addDocumentCom")
    public OkrResult<AddDocumentComRespDto> addDocumentCom(@RequestBody @Validated AddDocumentComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.addDocumentCom(reqDTO));
    }
/**
   * D2-删除文档(公共)
   */
    @PostMapping("deleteDocumentCom")
    public OkrResult<DeleteDocumentComRespDto> deleteDocumentCom(@RequestBody @Validated DeleteDocumentComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.deleteDocumentCom(reqDTO));
    }
/**
   * D2执行文件清理(公共)
   */
    @PostMapping("implementFileClearCom")
    public OkrResult<ImplementFileClearComRespDto> implementFileClearCom(@RequestBody @Validated ImplementFileClearComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementFileClearCom(reqDTO));
    }
/**
   * D2新增文档关系(公共)
   */
    @PostMapping("addUnstructuredRelationshipCom")
    public OkrResult<AddUnstructuredRelationshipComRespDto> addUnstructuredRelationshipCom(@RequestBody @Validated AddUnstructuredRelationshipComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.addUnstructuredRelationshipCom(reqDTO));
    }
/**
   * D2查询文档关系实例列表(公共)
   */
    @PostMapping("queryUnstructuredRelationshipInstanceListCom")
    public OkrResult<QueryUnstructuredRelationshipInstanceListComRespDto> queryUnstructuredRelationshipInstanceListCom(@RequestBody @Validated QueryUnstructuredRelationshipInstanceListComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryUnstructuredRelationshipInstanceListComRespDto retData = unstructuredDataService.queryUnstructuredRelationshipInstanceListCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D2执行分离新增或删除文档列表(公共)
   */
    @PostMapping("implementSeparateAddOrDeleteDocListCom")
    public OkrResult<ImplementSeparateAddOrDeleteDocListComRespDto> implementSeparateAddOrDeleteDocListCom(@RequestBody @Validated ImplementSeparateAddOrDeleteDocListComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementSeparateAddOrDeleteDocListCom(reqDTO));
    }
/**
   * D2删除文档关系(公共)
   */
    @PostMapping("deleteUnstructuredRelationshipCom")
    public OkrResult<DeleteUnstructuredRelationshipComRespDto> deleteUnstructuredRelationshipCom(@RequestBody @Validated DeleteUnstructuredRelationshipComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.deleteUnstructuredRelationshipCom(reqDTO));
    }
/**
   * D2删除单个文档关系或文档(公共)
   */
    @PostMapping("deleteSingleDocRelOrDocCom")
    public OkrResult<DeleteSingleDocRelOrDocComRespDto> deleteSingleDocRelOrDocCom(@RequestBody @Validated DeleteSingleDocRelOrDocComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.deleteSingleDocRelOrDocCom(reqDTO));
    }
/**
   * D2执行上传文档(公共)
   */
    @PostMapping("implementUploadFileCom")
    public OkrResult<ImplementUploadFileComRespDto> implementUploadFileCom(@RequestBody @Validated ImplementUploadFileComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementUploadFileCom(reqDTO));
    }
/**
   * D2执行文档数据集交集合并字段(公共)
   */
    @PostMapping("implementDocDataSetMergeFieldCom")
    public OkrResult<ImplementDocDataSetMergeFieldComRespDto> implementDocDataSetMergeFieldCom(@RequestBody @Validated ImplementDocDataSetMergeFieldComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementDocDataSetMergeFieldCom(reqDTO));
    }
/**
   * D2执行清理个人用户无效文件(公共)
   */
    @PostMapping("implementClearMemberInvalidDocCom")
    public OkrResult<ImplementClearMemberInvalidDocComRespDto> implementClearMemberInvalidDocCom(@RequestBody @Validated ImplementClearMemberInvalidDocComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementClearMemberInvalidDocCom(reqDTO));
    }
/**
   * D2删除文件夹(公共)
   */
    @PostMapping("deleteDataFolderCom")
    public OkrResult<DeleteDataFolderComRespDto> deleteDataFolderCom(@RequestBody @Validated DeleteDataFolderComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.deleteDataFolderCom(reqDTO));
    }
/**
   * D2修改文件夹(公共)
   */
    @PostMapping("updateDataFolderCom")
    public OkrResult<UpdateDataFolderComRespDto> updateDataFolderCom(@RequestBody @Validated UpdateDataFolderComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.updateDataFolderCom(reqDTO));
    }
/**
   * D2新增文件夹(公共)
   */
    @PostMapping("addDataFolderCom")
    public OkrResult<AddDataFolderComRespDto> addDataFolderCom(@RequestBody @Validated AddDataFolderComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.addDataFolderCom(reqDTO));
    }
/**
   * D2查询文件夹列表(公共)
   */
    @PostMapping("queryDataFolderListCom")
    public OkrResult<QueryDataFolderListComRespDto> queryDataFolderListCom(@RequestBody @Validated QueryDataFolderListComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryDataFolderListComRespDto retData = unstructuredDataService.queryDataFolderListCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D2查询我的网盘最新文档列表(公共)
   */
    @PostMapping("queryMyNetDiskLatestDocListCom")
    public OkrResult<QueryMyNetDiskLatestDocListComRespDto> queryMyNetDiskLatestDocListCom(@RequestBody @Validated QueryMyNetDiskLatestDocListComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryMyNetDiskLatestDocListComRespDto retData = unstructuredDataService.queryMyNetDiskLatestDocListCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D2修改文件夹业务处理(公共)
   */
    @PostMapping("updateDataFolderBizProCom")
    public OkrResult<UpdateDataFolderBizProComRespDto> updateDataFolderBizProCom(@RequestBody @Validated UpdateDataFolderBizProComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.updateDataFolderBizProCom(reqDTO));
    }
/**
   * D2删除文件夹业务处理(公共)
   */
    @PostMapping("deleteDataFolderBizProCom")
    public OkrResult<DeleteDataFolderBizProComRespDto> deleteDataFolderBizProCom(@RequestBody @Validated DeleteDataFolderBizProComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.deleteDataFolderBizProCom(reqDTO));
    }
/**
   * D2新增文件夹业务处理(公共)
   */
    @PostMapping("addDataFolderBizProCom")
    public OkrResult<AddDataFolderBizProComRespDto> addDataFolderBizProCom(@RequestBody @Validated AddDataFolderBizProComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.addDataFolderBizProCom(reqDTO));
    }
/**
   * D2批量查询文档关系By父内容id(公共)
   */
    @PostMapping("batchQueryUnstructuredRelationshipCom")
    public OkrResult<BatchQueryUnstructuredRelationshipComRespDto> batchQueryUnstructuredRelationshipCom(@RequestBody @Validated BatchQueryUnstructuredRelationshipComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchQueryUnstructuredRelationshipCom(reqDTO));
    }
/**
   * D2批量查询文档关系By归属内容表主键id(公共)
   */
    @PostMapping("batchQueryDmAttRelaCom")
    public OkrResult<BatchQueryDmAttRelaComRespDto> batchQueryDmAttRelaCom(@RequestBody @Validated BatchQueryDmAttRelaComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchQueryDmAttRelaCom(reqDTO));
    }
/**
   * D2批量增文档关系(公共)
   */
    @PostMapping("batchAddUnstructuredRelationshipCom")
    public OkrResult<BatchAddUnstructuredRelationshipComRespDto> batchAddUnstructuredRelationshipCom(@RequestBody @Validated BatchAddUnstructuredRelationshipComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchAddUnstructuredRelationshipCom(reqDTO));
    }
/**
   * D2查询文档关系列表(公共)
   */
    @PostMapping("queryUnstructuredRelationshipListCom")
    public OkrResult<QueryUnstructuredRelationshipListComRespDto> queryUnstructuredRelationshipListCom(@RequestBody @Validated QueryUnstructuredRelationshipListComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.queryUnstructuredRelationshipListCom(reqDTO));
    }
/**
   * D2修改文档关系(公共)
   */
    @PostMapping("updateUnstructuredRelationshipCom")
    public OkrResult<UpdateUnstructuredRelationshipComRespDto> updateUnstructuredRelationshipCom(@RequestBody @Validated UpdateUnstructuredRelationshipComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.updateUnstructuredRelationshipCom(reqDTO));
    }
/**
   * D2查询文档关系详情(公共)
   */
    @PostMapping("queryUnstructuredRelationshipDetailCom")
    public OkrResult<QueryUnstructuredRelationshipDetailComRespDto> queryUnstructuredRelationshipDetailCom(@RequestBody @Validated QueryUnstructuredRelationshipDetailComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.queryUnstructuredRelationshipDetailCom(reqDTO));
    }
/**
   * D2新增文档关系业务处理(公共)
   */
    @PostMapping("addUnstructuredDataRelationshipBizProCom")
    public OkrResult<AddUnstructuredDataRelationshipBizProComRespDto> addUnstructuredDataRelationshipBizProCom(@RequestBody @Validated AddUnstructuredDataRelationshipBizProComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.addUnstructuredDataRelationshipBizProCom(reqDTO));
    }
/**
   * D2执行分析文档关系排序(公共)
   */
    @PostMapping("implementAnalyzeUnstructuredRelationshipSortCom")
    public OkrResult<ImplementAnalyzeUnstructuredRelationshipSortComRespDto> implementAnalyzeUnstructuredRelationshipSortCom(@RequestBody @Validated ImplementAnalyzeUnstructuredRelationshipSortComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementAnalyzeUnstructuredRelationshipSortCom(reqDTO));
    }
/**
   * D2执行循环增文档关系(公共)
   */
    @PostMapping("implementLoopAddUnstructuredRelationshipCom")
    public OkrResult<ImplementLoopAddUnstructuredRelationshipComRespDto> implementLoopAddUnstructuredRelationshipCom(@RequestBody @Validated ImplementLoopAddUnstructuredRelationshipComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementLoopAddUnstructuredRelationshipCom(reqDTO));
    }
/**
   * D2批量增文档关系业务处理(公共)
   */
    @PostMapping("batchAddUnstructuredDataRelationshipBizProCom")
    public OkrResult<BatchAddUnstructuredDataRelationshipBizProComRespDto> batchAddUnstructuredDataRelationshipBizProCom(@RequestBody @Validated BatchAddUnstructuredDataRelationshipBizProComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchAddUnstructuredDataRelationshipBizProCom(reqDTO));
    }
/**
   * D2批量删文档关系或文档(公共)
   */
    @PostMapping("batchDeleteDocRelOrDocCom")
    public OkrResult<BatchDeleteDocRelOrDocComRespDto> batchDeleteDocRelOrDocCom(@RequestBody @Validated BatchDeleteDocRelOrDocComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchDeleteDocRelOrDocCom(reqDTO));
    }
/**
   * D2执行校验文档数据集合法性(公共)
   */
    @PostMapping("implementCheckDocListValidityCom")
    public OkrResult<ImplementCheckDocListValidityComRespDto> implementCheckDocListValidityCom(@RequestBody @Validated ImplementCheckDocListValidityComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementCheckDocListValidityCom(reqDTO));
    }
/**
   * D2批量查询文档关系实例by归属工作周期ID(公共)
   */
    @PostMapping("batchQueryUnstructuredRelationshipInstanceCom")
    public OkrResult<BatchQueryUnstructuredRelationshipInstanceComRespDto> batchQueryUnstructuredRelationshipInstanceCom(@RequestBody @Validated BatchQueryUnstructuredRelationshipInstanceComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchQueryUnstructuredRelationshipInstanceCom(reqDTO));
    }
/**
   * D2执行文档关系补偿文档名称(公共)
   */
    @PostMapping("implementUnstructuredRelationshipCompDocNameCom")
    public OkrResult<ImplementUnstructuredRelationshipCompDocNameComRespDto> implementUnstructuredRelationshipCompDocNameCom(@RequestBody @Validated ImplementUnstructuredRelationshipCompDocNameComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.implementUnstructuredRelationshipCompDocNameCom(reqDTO));
    }
/**
   * D2查询文档列表(公共)
   */
    @PostMapping("queryDocumentListCom")
    public OkrResult<QueryDocumentListComRespDto> queryDocumentListCom(@RequestBody @Validated QueryDocumentListComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.queryDocumentListCom(reqDTO));
    }
/**
   * D2批量查询文档关系实例by归属内容表主键(公共)
   */
    @PostMapping("batchQueryUnstructuredRelationshipInstanceByOwnEntityIdCom")
    public OkrResult<BatchQueryUnstructuredRelationshipInstanceByOwnEntityIdComRespDto> batchQueryUnstructuredRelationshipInstanceByOwnEntityIdCom(@RequestBody @Validated BatchQueryUnstructuredRelationshipInstanceByOwnEntityIdComReqDto reqDTO){
    return OkrResult.success(unstructuredDataService.batchQueryUnstructuredRelationshipInstanceByOwnEntityIdCom(reqDTO));
    }


}
  